Skip to content

Conversation

@giamir
Copy link
Contributor

@giamir giamir commented Jan 27, 2026

While working on #2145 I noticed that the retry logic of our visual tests was silently make the suite pass on exhausted retries.

More context
In visual-test-utils.ts, the retry logic was designed to retry non-"Visual diff" errors (like timing issues), but it had a critical flaw: when all 3 retries were exhausted, the do-while loop exited without throwing the error, causing the test to silently pass.
The actual error being thrown was:
Screenshot is not the same width and height as the baseline. Baseline: { width: 227, height: 114 } Screenshot: { width: 256, height: 128 }
This error doesn't contain "Visual diff failed.", so it triggered the retry path but never failed the test.
The fix was to track the last error and throw it after the loop exits if we never succeeded.

A lot of the baseline images had to be regenerated because they were silently failing from the time that we changed the width and height atomic classes.

@changeset-bot
Copy link

changeset-bot bot commented Jan 27, 2026

⚠️ No Changeset found

Latest commit: 7de0226

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@netlify
Copy link

netlify bot commented Jan 27, 2026

Deploy Preview for stacks-svelte ready!

Name Link
🔨 Latest commit 7de0226
🔍 Latest deploy log https://app.netlify.com/projects/stacks-svelte/deploys/69789d7bfa0b81000856100f
😎 Deploy Preview https://deploy-preview-2147--stacks-svelte.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Jan 27, 2026

Deploy Preview for stacks ready!

Name Link
🔨 Latest commit 7de0226
🔍 Latest deploy log https://app.netlify.com/projects/stacks/deploys/69789d7b183657000818fe5e
😎 Deploy Preview https://deploy-preview-2147--stacks.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@giamir giamir changed the title test(visual): fix retry logic silently passes on exhausted retries test(visual): fix retry logic silently passing on exhausted retries Jan 27, 2026
@giamir giamir enabled auto-merge (squash) January 27, 2026 11:19
@giamir giamir merged commit 74fc4e3 into beta Jan 27, 2026
19 checks passed
@giamir giamir deleted the gbuoncristiani/fix-visual-regression-tests branch January 27, 2026 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants